/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package minitestdrive.doa;

import minitestdrive.domain.customer.Customer;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.HibernateUtil;

/**
 *
 * @author emickelson
 */
public class CustomerDoa {

    Session session;

    CustomerDoa() {
        this.session = HibernateUtil.getSessionFactory().getCurrentSession();
    }

    Customer get(long id) {
        Transaction tx = this.session.beginTransaction();
        return (Customer)this.session.get(Customer.class, id);
    }
}
